using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace WcfService1.DTO
{
    [DataContract]
    public class UserDTO : INotifyPropertyChanged
    {
        private String _Department;
        private String _Email;
        private String _NamaLengkap;
        private int _No;
        private String _Password;
        private ObservableCollection<RoleDTO> _Roles;
        private String _Telp;
        private String _UserID;


        private String _UserName;
        private String _created_by;
        private DateTime? _created_date;
        private bool _isSelected;
        private String _modified_by;
        private DateTime? _modified_date;

        [DataMember]
        public String UserID
        {
            get { return _UserID; }
            set
            {
                _UserID = value;
                RaisePropertyChanged("UserID");
            }
        }

        [DataMember]
        public String UserName
        {
            get { return _UserName; }
            set
            {
                _UserName = value;
                RaisePropertyChanged("UserName");
            }
        }


        [DataMember]
        public String Password
        {
            get { return _Password; }
            set
            {
                _Password = value;
                RaisePropertyChanged("Password");
            }
        }


        [DataMember]
        public String NamaLengkap
        {
            get { return _NamaLengkap; }
            set
            {
                _NamaLengkap = value;
                RaisePropertyChanged("NamaLengkap");
            }
        }


        [DataMember]
        public String Email
        {
            get { return _Email; }
            set
            {
                _Email = value;
                RaisePropertyChanged("Email");
            }
        }


        [DataMember]
        public String Telp
        {
            get { return _Telp; }
            set
            {
                _Telp = value;
                RaisePropertyChanged("Telp");
            }
        }


        [DataMember]
        public ObservableCollection<RoleDTO> Roles
        {
            get { return _Roles; }
            set
            {
                _Roles = value;
                RaisePropertyChanged("Roles");
            }
        }


        [DataMember]
        public String created_by
        {
            get { return _created_by; }
            set
            {
                _created_by = value;
                RaisePropertyChanged("created_by");
            }
        }


        [DataMember]
        public DateTime? created_date
        {
            get { return _created_date; }
            set
            {
                _created_date = value;
                RaisePropertyChanged("created_date");
            }
        }

        [DataMember]
        public String modified_by
        {
            get { return _modified_by; }
            set
            {
                _modified_by = value;
                RaisePropertyChanged("modified_by");
            }
        }


        [DataMember]
        public DateTime? modified_date
        {
            get { return _modified_date; }
            set
            {
                _modified_date = value;
                RaisePropertyChanged("modified_date");
            }
        }

        [DataMember]
        public String Department
        {
            get { return _Department; }
            set
            {
                _Department = value;
                RaisePropertyChanged("Department");
            }
        }

        public int No
        {
            get { return _No; }
            set
            {
                _No = value;
                RaisePropertyChanged("No");
            }
        }

        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                RaisePropertyChanged("IsSelected");
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void RaisePropertyChanged(string propertyname)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyname));
        }
    }
}